package com.example.register.controller;


/*
负责具体的业务模块流程的控制，主要调用service层里面的接口控制具体的业务流程
 */

import com.example.register.entity.Result;
import com.example.register.service.UserServiceImp;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@CrossOrigin
public class UserController {
    @Resource
    private UserServiceImp userService;

    //注册服务
    //通过映射来找到地址
    @RequestMapping(value = "register",method = RequestMethod.POST)
    public Result userRegister(@RequestParam Map<String,String> regInfo){
        System.out.println("要返回的结果"+userService.register(regInfo));
        return userService.register(regInfo);
    }



}

